#pragma once


#define 	HEAP_MAX_FREE_LIST 80
class Heap
{
public:
	Heap(void);
	~Heap(void);
	void*	allocate(size_t size);

	void	deallocate(void* op);
private:
	void*	m_freeList[HEAP_MAX_FREE_LIST];
	int		m_numFree;
};


#define DECLARE_HEAP\
	public:\
	static void*	operator new(size_t size);\
	static void		operator delete(void* p);\
	private:\
	static	Heap	s_heap;


#define  DEFINE_HEAP(className)\
	Heap	className::s_heap;\
	void*	className::operator new(size_t size)\
			{\
				return	s_heap.allocate(size);\
			}\
	void	className::operator delete(void* p)\
			{\
				s_heap.deallocate(p);\
			}
